<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Test whether an entry represents a directory</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="rarentry.getversion.html">« RarEntry::getVersion</a></li>
      <li style="float: right;"><a href="rarentry.isencrypted.html">RarEntry::isEncrypted »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.rarentry.html">RarEntry</a></li>
    <li>Test whether an entry represents a directory</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="rarentry.isdirectory" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">RarEntry::isDirectory</h1>
  <p class="verinfo">(PECL rar &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">RarEntry::isDirectory</span> &mdash; <span class="dc-title">Test whether an entry represents a directory</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-rarentry.isdirectory-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>RarEntry::isDirectory</strong></span>(): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Tests whether the current entry is a directory.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-rarentry.isdirectory-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-rarentry.isdirectory-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>true</code></strong> if this entry is a directory and <strong><code>false</code></strong> otherwise.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-rarentry.isdirectory-notes">
  <h3 class="title">注释</h3>
  <p class="para">
  This function is only available starting with version 2.0.0, but one can
  also test whether an entry is a directory by checking the entry attributes,
  like this (only works for files compressed in RAR for Windows or Unix):
  <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//...<br />//Open&nbsp;file,&nbsp;get&nbsp;entry&nbsp;and&nbsp;store&nbsp;in&nbsp;variable&nbsp;$e...<br />//...<br /><br /></span><span style="color: #0000BB">$isDirectory&nbsp;</span><span style="color: #007700">=&nbsp;(bool)&nbsp;(((</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getHostOs</span><span style="color: #007700">()&nbsp;==&nbsp;</span><span style="color: #0000BB">RAR_HOST_WIN32</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getAttr</span><span style="color: #007700">()&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0x10</span><span style="color: #007700">))&nbsp;||<br />&nbsp;&nbsp;&nbsp;&nbsp;((</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getHostOs</span><span style="color: #007700">()&nbsp;==&nbsp;</span><span style="color: #0000BB">RAR_HOST_UNIX</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;((</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getAttr</span><span style="color: #007700">()&nbsp;&amp;&nbsp;</span><span style="color: #0000BB">0xf000</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">0x4000</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

  </p>
 </div>


</div></div></div></body></html>